package utils;

import org.springframework.cglib.beans.BeanMap;

import java.util.HashMap;
import java.util.Map;

public class BeanMapUtils {
    public static <T> Map<String,Object> beanToMap(T bean){
        Map<String,Object>map=new HashMap<String, Object>();
        if (bean!=null){
            BeanMap beanMap = BeanMap.create(bean);
            for (Object key:beanMap.keySet()){
                map.put(key+" ",beanMap.get(key));
            }
        }
        return map;
    }
}
